
/**
 * 进入随堂练习弹窗
 * @param _courseId 课程ID
 * @param catalogId 目录ID
 * @param questionIds 试题ID
 */
function popupExerciseConfirm(_courseId,catalogId,questionIds,type,callback) {
    Zepto.ajax({
        url: baseloaction +'/mobile/uc/play/exercises/checkExercises',
        type:'post',
        dataType:'json',
        data:{
            'courseId':_courseId,
            'catalogId':catalogId
        },
        success:function (result) {
            if(result.success==true){
                if($.isFunction(callback)){
                    callback(result.entity);
                }else{
                    var text = Zepto('#c-classTest-ele').val();
                    Zepto.confirm(text, function () {
                        window.location.href = baseloaction + '/mobile/uc/play/exercises/loadExercises?examRecordId='+result.entity;
                    });
                    var count = questionIds.split(',').length - 2;
                    Zepto('.modal-in').find('#question-count').text(count);
                    if(type==2){
                        Zepto('.modal-in').css("margin-top","0px");
                    }
                    Zepto('.modal-in').find('.modal-button').text('我再想想').css('color', '#bbb');
                    Zepto('.modal-in').find('.modal-button-bold').text('进入随堂练习').attr('style', '');
                }
            }else{
                Zepto.toast(result.message);
            }
        },
        error:function (error) {
            Zepto.toast("系统错误，随堂练习失败");
        }
    });
}